package com.c5c6;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

public class RegisterServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws SecurityException, IOException{
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        request.setCharacterEncoding("UTF-8");
        String username = request.getParameter("username");
        String userPwd = request.getParameter("userPwd");
        String Email = request.getParameter("email");
        String userSex = request.getParameter("userSex");
        String userEducation = request.getParameter("userEduction");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<HEAD><TITLE>用户注册结果</TITLE></HEAD>");
        out.println("<BODY><br/>");
        out.println("<h3>用户注册结果</h3>");
        out.println("<table border=1> align=left");
        out.println("<tr><th>参数</th><th>参数值</th></tr>");
        out.println("<tr><td>userName</td><td>" +username+ "</th></tr>");
        out.println("<tr><td>userPwd</td><td>" +userPwd+ "</th></tr>");
        out.println("<tr><td>Email</td><td>" +Email+ "</th></tr>");
        out.println("<tr><td>userSex</td><td>" +userSex+ "</th></tr>");
        out.println("<tr><td>userEducation</td><td>" +userEducation+ "</th></tr>");
        out.println("</table></body>");
        out.println("</html>");
        out.flush();
        out.close();
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws SecurityException, IOException{
        doPost(request, response);{
        }
    }
}

